

sha256withRSA(inputString,privateKeyString) {
	let {KEYUTIL, KJUR, hextob64, hextob64u} = require('jsrsasign');
    const key = KEYUTIL.getKey(privateKeyString);
    // 创建 Signature 对象，设置签名编码算法
    const signature = new KJUR.crypto.Signature({ alg: 'SHA256withRSA' });
    // 初始化
    signature.init(key);
    // 传入待加密字符串
    signature.updateString(inputString);
    // 生成密文
    const originSign = signature.sign();
    console.log('originSign:', originSign)
    const sign64 = hextob64(originSign);
    console.log('sign base64:', sign64);
    // const sign64u = hextob64u(originSign);
    // console.log('sign base64u=======', sign64u);
    return originSign;
}


module.exports = {
    sha256withRSA
}